package com.qinghe.pro.entity.article;

import java.io.Serializable;
import java.util.Date;

import org.apache.commons.lang3.StringUtils;

import com.qinghe.utils.RegHtml;

public class Article implements Serializable {
	private static final long serialVersionUID = 5119443919443177379L;

	private Integer id;

    private Column column;

    private String title;

    private String author;

    private String url;

    private Date createTime;

    private String content;

    private String desc;// 去除内容中的html代码并截取

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Column getColumn() {
		return column;
	}

	public void setColumn(Column column) {
		this.column = column;
	}

	public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title == null ? null : title.trim();
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author == null ? null : author.trim();
    }

    public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
        this.url = url == null ? null : url.trim();
	}

	public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content == null ? null : content.trim();
    }

	public String getDesc() {
		if (StringUtils.isNotBlank(content))
			return  RegHtml.splitAndFilterString(content, 100);
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}